/* 
 * File:   newmain.cpp
 * Author: ben
 *
 * Created on April 5, 2009, 10:36 PM
 */

#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>

/*
 * 
 */
using namespace std;

int main(int argc, char** argv) {
    string temp;
    if(argc!=2){
        return(-1);
    }

    cout << "reading:" << argv[1] << endl;
    ifstream fin(argv[1]);
    ofstream fout("filelist.xml");
    fout << "<list>" << endl;
    fout << "<header>"<< endl;
    fout << "<author name=\"Vermoortel Benoit\"/>"<< endl;
    fout << "<comments>Auto generated filelist</comments>"<< endl;
    fout << "</header>"<< endl;
    fout << "<files>" << endl;
        
    while(!fin.eof()){
        fin >> temp;
        fout << "<file path=\"" << temp << "\"/>" << endl;
    }
    fout << "</files>" << endl;
    fout << "</list>" << endl;

    return (EXIT_SUCCESS);
}

